package com.ruoyi.common.utils.js;

import org.springframework.web.bind.annotation.RequestParam;

public class WaterLevelCompute {
    public static String GetQualityLevelName(int level)
    {
        String name = "";
        switch (level)
        {
            case 10:
                name = "Ⅰ类";
                break;
            case 20:
                name = "Ⅱ类";
                break;
            case 30:
                name = "Ⅲ类";
                break;
            case 40:
                name = "Ⅳ类";
                break;
            case 50:
                name = "Ⅴ类";
                break;
            case 60:
                name = "劣Ⅴ类";
                break;
            case 61:
                name = "劣Ⅴ1类";
                break;
            case 62:
                name = "劣Ⅴ2类";
                break;
            case 63:
                name = "劣Ⅴ3类";
                break;
            case 64:
                name = "劣Ⅴ4类";
                break;
            default:
                name = "无类别";
                break;
        }
        return name;
    }

    public static String GetLevelName(int level, @RequestParam(value = "defValue", required = false, defaultValue = "无类别") String defValue)
    {
        switch (level)
        {
            case 1:
                return "Ⅰ类";
            case 2:
                return "Ⅱ类";
            case 3:
                return "Ⅲ类";
            case 4:
                return "Ⅳ类";
            case 5:
                return "Ⅴ类";
            case 6:
                return "劣Ⅴ类";
            default:
                return defValue;
        }
    }
    public static String GetLevelCNName(int level, @RequestParam(value = "defValue", required = false, defaultValue = "无类别") String defValue)
    {
        switch (level)
        {
            case 1:
                return "I类";
            case 2:
                return "II类";
            case 3:
                return "III类";
            case 4:
                return "IV类";
            case 5:
                return "V类";
            case 6:
                return "劣V类";
            default:
                return defValue;
        }
    }

    /**
     * @title getPollutionLevelName
     * @description  根据水质级别获取水质污染等级名称 优，良，轻度污染，中度污染，重度污染、严重污染
     * @param level  污染等级
     * @param defValue
     * @return java.lang.String
     */
    public static String getPollutionLevelName(int level, @RequestParam(value = "defValue", required = false, defaultValue = "无类别") String defValue)
    {
        switch (level)
        {
            case 1:
                return "优";
            case 2:
                return "良";
            case 3:
                return "轻度污染";
            case 4:
                return "中度污染";
            case 5:
                return "重度污染";
            case 6:
                return "严重污染";
            default:
                return defValue;
        }
    }
}
